//请求工具参考https://ext.dcloud.net.cn/plugin?id=392

//获取用户信息
export const getUserInfo = params => uni.$u.http.get('/collegebase/student/move/get',{params})
export const getTeacherUserInfo = params => uni.$u.http.get('/collegebase/teacher-teachers/get',{params})
//请假申请
export const leaveApply = data => uni.$u.http.post('/study/student/attendance/apply/leave',data)
//请假申请
export const teacherLeaveApply = data => uni.$u.http.post('/study/teacher/move/apply/leave',data)

//获取请假类型
export const getLeaveReason = params => uni.$u.http.get('/study/student/attendance/getLeaveReason',params)
// 教师端 获取请假类型
export const getTeacherLeaveReason = params => uni.$u.http.get('/study/teacher/attendance/getLeaveReason',params)

//获取请假审批人列表
export const studentSubmitList = params => uni.$u.http.get('/study/student/attendance/move/studentSubmitList',{params})
// 教师端 获取请假审批列表
export const teacherAllList = params => uni.$u.http.get('/study/teacher/move/teacherAllList',{params})
// 
export const getTeacherBossUser = params => uni.$u.http.get('/study/teacher/move/getTeacherBossUser',{params})

//学生请假列表
export const attendanceList = params => uni.$u.http.get('/study/student/attendance/list',{params})
// 教师请假列表
export const getTeacherAttendanceList = params => uni.$u.http.get('/study/teacher/move/list',{params})
// 请假审批列表
export const getTeacherleaveCheckList = params => uni.$u.http.get('/study/teacher/move/leave/check/page',{params})
// 请假审批记录列表
export const getCheckList = params => uni.$u.http.get('/study/teacher/move/log/page',{params})
// 请假审批详情
export const getTeacherleaveCheckDetail = params => uni.$u.http.get('/study/teacher/move/leave/get/info',{params})
// 请假审批
export const checkLeave = data => uni.$u.http.put('/study/teacher/move/leave/check',data)
// 打卡记录(考勤记录)  学生端
export const getStudentClockList = queryStr => uni.$u.http.get('/study/student/attendance/move/studentClockPage'+queryStr)
// // 打卡记录(考勤记录)  教师端
export const getTeacherClockList = queryStr => uni.$u.http.get('/study/teacher/move/student/clock/page'+queryStr)
// 今日考勤 学生端
export const getTodayClock = params => uni.$u.http.get('/study/student/attendance/move/getTodayClock',{params})
// 今日考勤 教师端
export const getTeacherTodayClock = params => uni.$u.http.get('/study/teacher/move/getTodayClock',{params})
//获取所有字典
export const getClockStatus = params => uni.$u.http.get('/admin-api/system/dict-data/list-all-simple',{params})
//获取链接
export const getLink = params => uni.$u.http.get('/admin-api/system/auth/social-auth-redirect',{params})
// 社交快捷登录，使用 code 授权码
export const socialLogin = data => uni.$u.http.post('/admin-api/system/auth/social-login',data)
// 学生创建打卡
export const createClock = data => uni.$u.http.post('/study/student/attendance/move/clock/create',data)
// 老师创建打卡记录
export const createTeacherClock = data => uni.$u.http.post('/study/teacher/move/clock/create',data)
// 老师编辑信息
export const updateTeacherInfo = data => uni.$u.http.post('/collegebase/teacher-teachers/move/update',data)
// 学生信息完善
export const updateStudentInfo = data => uni.$u.http.post('/collegebase/student/move/update',data)

// 扫码打卡
export const scanCodeClock = data => uni.$u.http.post('/study/student/attendance/move/scanCodeClock',data)
//获取生成二维码字符串
export const getQrCodeStr = params => uni.$u.http.get('/study/teacher/move/getQrCodeStr',{params})
// 教师获取今日课程列表
export const getTodayClassTimetable = params => uni.$u.http.get('/study/teacher/move/getTodayClassTimetable',{params})
//
export const getTodayStudySubject = params => uni.$u.http.get('/study/student/attendance/move/getTodaySubject',{params})

//
//修改用户头像
export const updateAvatar = filePath =>
  uni.$u.http.upload('/member/user/update-avatar', {
    name: 'avatarFile',
    fileType: 'image',
    filePath: filePath
  })


export const upload = file => uni.$u.http.upload('/admin-api/infra/file/upload',file);

//修改用户昵称
export const updateNickname = params => uni.$u.http.put('/member/user/update-nickname', {}, { params })
